
set(OHRENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

set(CMAKE_CXX_STANDARD 17)

include_directories(${OHRENDER_ROOT_PATH}
                    ${OHRENDER_ROOT_PATH}/include
                    ${OHRENDER_ROOT_PATH}/modules/skparagraph/include
                    ${OHRENDER_ROOT_PATH}/third_party/icu
                    ${OHRENDER_ROOT_PATH}/third_party/expat/expat/lib)

file(GLOB_RECURSE SRC_FILES
    "src/*.cpp"
    "modules/skcms/*.cc"
    "modules/skparagraph/*.cpp"
    "modules/skresources/*.cpp"
    "modules/svg/src/*.cpp"
    "modules/skshaper/src/SkShaper.cpp"
    "modules/skshaper/src/SkShaper_primitive.cpp"
    )

add_library(OHRender SHARED ${SRC_FILES})

#add_subdirectory(third_party/expat/expat)

set(LIBEXPAT_PATH "${OHRENDER_ROOT_PATH}/third_party/libs/${CMAKE_SYSTEM_PROCESSOR}_libexpat.a")
add_library(expat STATIC IMPORTED)
set_target_properties(expat PROPERTIES IMPORTED_LOCATION ${LIBEXPAT_PATH})

add_dependencies(OHRender expat)
target_link_libraries(OHRender PUBLIC expat)

target_compile_definitions(OHRender PUBLIC SK_BUILD_FOR_OHOS)


target_link_libraries(OHRender PUBLIC libace_napi.z.so)
target_link_libraries(OHRender PUBLIC libhilog_ndk.z.so)
target_link_libraries(OHRender PUBLIC libnative_drawing.so)
target_link_libraries(OHRender PUBLIC libpixelmap.so)
target_link_libraries(OHRender PUBLIC libpixelmap_ndk.z.so)
target_link_libraries(OHRender PUBLIC libimage_source.so)
target_link_libraries(OHRender PUBLIC libhitrace_ndk.z.so)
target_link_libraries(OHRender PUBLIC libuv.so)
target_link_libraries(OHRender PUBLIC libimage_packer.so)
target_link_libraries(OHRender PUBLIC libace_ndk.z.so)
